
//Copyright 1997-2009 Syrinx Development, Inc.
//This file is part of the Syrinx Web Application Framework (SWAF).
// == BEGIN LICENSE ==
//
// Licensed under the terms of any of the following licenses at your
// choice:
//
//  - GNU General Public License Version 3 or later (the "GPL")
//    http://www.gnu.org/licenses/gpl.html
//
//  - GNU Lesser General Public License Version 3 or later (the "LGPL")
//    http://www.gnu.org/licenses/lgpl.html
//
//  - Mozilla Public License Version 1.1 or later (the "MPL")
//    http://www.mozilla.org/MPL/MPL-1.1.html
//
// == END LICENSE ==
using System;
using System.Collections;

namespace Swaf.Messaging
{
	/// <summary>
	/// Scott Matthews - 10.22.2004
	/// CQ ID: CUSP00005551 - EMail Messaging Provider
	/// Summary description for EmailMessage.
	/// </summary>
	[Serializable()]
	public class EmailMessage
	{
		/// <summary>
		/// Default constructor
		/// </summary>	
		public EmailMessage() {}

		#region Properties
		/// <summary>
		/// The body of the message
		/// </summary>
		public String Body
		{
			get {return m_body;}
			set {m_body = value;}
		}
		/// <summary>
		/// Who the message is being sent to
		/// </summary>
		public String To
		{
			get {return m_to;}
			set {m_to = value;}
		}
		/// <summary>
		/// Who the message is from
		/// </summary>
		public String From
		{
			get {return m_from;}
			set {m_from = value;}
		}
		/// <summary>
		/// Who the message will be copied to
		/// </summary>
		public String Cc
		{
			get {return m_cc;}
			set {m_cc = value;}
		}
		/// <summary>
		/// Who the message will be blind copied to
		/// </summary>
		public String Bcc
		{
			get {return m_bcc;}
			set {m_bcc = value;}
		}
		/// <summary>
		/// Who the reply should be sent to 
		/// </summary>
		public String ReplyTo
		{
			get {return m_replyTo;}
			set {m_replyTo = value;}
		}
		/// <summary>
		/// The subject of the message
		/// </summary>
		public String Subject
		{
			get {return m_subject;}
			set {m_subject = value;}
		}
		/// <summary>
		/// The format of the message valid entries are HTML and TEXT
		/// </summary>
		public String Format
		{
			get {return m_format;}
			set {m_format = value;}
		}
		/// <summary>
		/// The priority of the message valid entries are LOW, MEDIUM, and HIGH
		/// </summary>
		public String Priority
		{
			get {return m_priority;}
			set {m_priority = value;}
		}
		/// <summary>
		/// The server to use for SMTP or the profile to use for EXCHANGE
		/// </summary>
		public String HostName
		{
			get {return m_hostName;}
			set {m_hostName = value;}
		}

        /// <summary>
		/// The attachment
		/// </summary>
		public IList Attachments
		{
			get {return m_attachments;}
			set {m_attachments = value;}
		}
		#endregion

		#region Members
		private String m_body = String.Empty;
		private String m_replyTo = String.Empty;
		private String m_to = String.Empty;
		private String m_from = String.Empty;
		private String m_cc = String.Empty;
		private String m_bcc = String.Empty;
		private String m_subject = String.Empty;
		private String m_format = "TEXT";
		private String m_priority = "LOW";
		private String m_hostName = String.Empty;

        private IList m_attachments = new ArrayList();
		#endregion
	}

    public class EmailAttachment : IMessageAttachment
    {
        private String m_name = String.Empty;
        private String m_path = String.Empty;
        private byte[] m_data = null;

        public EmailAttachment(string name, string path, byte[] data)
        {
            m_name = name;
            m_path = path;
            m_data = data;
        }

        public string Name { get { return m_name; } set { m_name = value; } }
        public string Path { get { return m_path; } set { m_path = value; } }
        public byte[] Data { get { return m_data; } set { m_data = value; } }
    }
}
